package
{
    import GUI.GUIWindow;
    import GUI.UI.UIDecorationStruct;
    import GUI.UI.UIEntity;
    
    public class CustomWindow extends GUIWindow
    {
        private var _scrollBar:CustomScrollBar;
        
        public function CustomWindow(sizeX:Number, sizeY:Number)
        {
            super(sizeX, sizeY);

            this.graphicsContent.lineStyle (1, 0xff00ff);
            this.graphicsContent.drawCircle(50, 50, 60);
            
            this.marginTop    = 20;
            this.marginBottom = 20;
            this.marginLeft   = 20;
            this.marginRight  = 20;
            
            this.decorate(new UIDecorationStruct());
        }
        
        public override function addChild(child:UIEntity):void
        {
            super.addChild(child);

            if(child is CustomScrollBar)
            { 
                var scrollBar:CustomScrollBar = child as CustomScrollBar;
                
                scrollBar.setSize(scrollBar.width, this.viewRectHeight);
                
                scrollBar.x = this.viewRectWidth - scrollBar.width;
            }
            
        }
    }
}